package com.lu.controller;

import com.lu.pojo.Url;
import com.lu.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;

import static com.lu.service.UserService.uimg;

@RestController
//@CrossOrigin解决跨越问题
public class UploadController {
    @Autowired
    private UploadService uploadService;
    @PostMapping("/Avatar")
    public String uploadFile(@RequestBody Url url) throws IOException {
        return uploadService.uploadFile(url,uimg);
    }
}
